package com.crazy.practice.boot.service.impl;

import com.crazy.practice.boot.service.UserService;
import com.crazy.practice.model.AverageUser;
import com.crazy.practice.model.UserOrder;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * @author panyonghui
 * @describe 用户操作对象
 * @date 2022/12/23 8:56
 */
@Service
public class UserServiceImpl implements UserService {
    @Override
    public List<UserOrder> userOrderQuery(AverageUser averageUser) {
        if (Objects.isNull(averageUser)){
            averageUser = new AverageUser();
        }
        averageUser.setUserSeq(100);
        averageUser.setUserId("120001");
        averageUser.setUserName("王丽丽");
        UserOrder userOrder = new UserOrder();
        userOrder.setUserSeq(1);
        userOrder.setGoodsId("1001");
        userOrder.setGoodsName("水杯");
        userOrder.setAverageUser(averageUser);
        List userList = new ArrayList<>();
        userList.add(userOrder);
        return userList;
    }
}
